#!/usr/bin/python3
# coding: utf-8
# file: dict_.py
# 字典的使用
# 2018-06-12


def filter_dict(dict_):
	'''过滤字典中的某个值'''
	f = filter(lambda i: i[0] != 'b', dict_.items())
	for i in f:
		print(i)

def copy_dict():
	d1 = {"a":1, "b":2}
	d2 = d1.copy()
	d2['c'] = 3
	print(d1, d2)

def get_dict():
	import string
	d = dict.fromkeys(string.ascii_uppercase, 2)
	print(d)


if __name__ == '__main__':
	# dict_ = {"a":1, "b":2}
	# filter_dict(dict_)
	# copy_dict()
	get_dict()
